package com.lhj.springboot.rpc.controller;

import com.lhj.springboot.rpc.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author lhj
 * @Date 2024/7/21 17:02
 */
@RestController
@RequestMapping("/v1/weather")
public class WeatherController {
    
    @Autowired
    WeatherService weatherService;
    
    @GetMapping("/getWeather")
    public ResponseEntity<?> getWeather(@RequestParam("cityName") String cityName) {
        return weatherService.getWeather(cityName);
    }
        
    @GetMapping("/notice/pageList")
    public ResponseEntity<?> noticePageList() {
        return weatherService.noticePageList();
    }
}
